/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.io.IOException;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import java.util.UUID;
/*     */ import java.util.concurrent.ExecutorService;
/*     */ import java.util.concurrent.Executors;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.model.ModelBase;
/*     */ import net.minecraft.client.renderer.texture.ITextureObject;
/*     */ import net.minecraft.client.renderer.texture.SimpleTexture;
/*     */ import net.minecraft.client.renderer.texture.TextureManager;
/*     */ import net.minecraft.client.renderer.texture.TextureUtil;
/*     */ import net.minecraft.client.resources.IResource;
/*     */ import net.minecraft.entity.EntityLivingBase;
/*     */ import net.minecraft.util.ResourceLocation;
/*     */ import net.minecraft.util.text.ITextComponent;
/*     */ import net.minecraft.util.text.TextComponentString;
/*     */ import org.yaml.snakeyamla.configuration.ConfigurationSection;
/*     */ import org.yaml.snakeyamla.configuration.file.YamlConfiguration;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class tr
/*     */ {
/*  40 */   public static final Map<String, zz> i = new HashMap<>();
/*  41 */   public static final HashMap<String, ModelBase> w = new HashMap<>();
/*  42 */   public static final Map<String, Map<String, vu>> q = new HashMap<>();
/*  43 */   private static final ExecutorService g = Executors.newCachedThreadPool();
/*     */   
/*     */   public static void h() {
/*  46 */     g.shutdownNow();
/*     */   }
/*     */   
/*     */   public static void z() {
/*  50 */     i.clear();
/*  51 */     w.clear();
/*  52 */     q.clear();
/*     */   }
/*     */   
/*     */   public static void v() {
/*  56 */     i.clear();
/*     */   }
/*     */   
/*     */   public static ModelBase v(ela.eos/moe/dragoncore/uba a) {
/*  60 */     String str = a.t();
/*     */     
/*  62 */     if (!w.containsKey(a.h())) {
/*  63 */       g.submit(() -> {
/*     */             try {
/*     */               ModelBase modelBase = null;
/*     */ 
/*     */ 
/*     */               
/*     */               if (a.h()) {
/*     */                 modelBase = (iy)zy.g.loadModel(new ResourceLocation("dragoncore", "models/items/" + str + "/model.pqc"));
/*     */               } else if (a.t()) {
/*     */                 modelBase = th.v(new ResourceLocation("dragoncore", "models/items/" + str + "/model.json"));
/*     */               } else if (a.v()) {
/*     */                 modelBase = se.v(new ResourceLocation("dragoncore", "models/items/" + str + "/model.obj"));
/*     */               } else {
/*     */                 (Minecraft.func_71410_x()).field_71439_g.func_145747_a((ITextComponent)new TextComponentString("§c未设定的物品模型类型:" + a.h()));
/*     */               } 
/*     */ 
/*     */ 
/*     */               
/*     */               if (modelBase != null) {
/*     */                 w.put(a.h(), modelBase);
/*     */               }
/*  84 */             } catch (Exception exception) {
/*     */               exception.printStackTrace();
/*     */               (Minecraft.func_71410_x()).field_71439_g.func_145747_a((ITextComponent)new TextComponentString("§c无法加载物品模型:" + a.h()));
/*     */             } 
/*     */           });
/*  89 */       w.put(a.h(), th.v());
/*     */     } 
/*     */     
/*  92 */     return w.get(a.h());
/*     */   }
/*     */   
/*     */   public static void z(ela.eos/moe/dragoncore/uba a) {
/*  96 */     String str = a.t();
/*  97 */     hw.v("models/items/" + str + "/texture.png");
/*     */   }
/*     */ 
/*     */   
/*     */   public static void v(ela.eos/moe/dragoncore/uba a) {
/* 102 */     String str = a.t();
/* 103 */     hw.v("models/items/" + str + "/glow_texture.png");
/*     */   }
/*     */   
/*     */   public static boolean v(ela.eos/moe/dragoncore/uba a) {
/*     */     SimpleTexture simpleTexture;
/* 108 */     String str = a.t();
/*     */     
/* 110 */     TextureManager textureManager = Minecraft.func_71410_x().func_110434_K();
/* 111 */     ResourceLocation resourceLocation = new ResourceLocation("dragoncore", "models/items/" + str + "/glow_texture.png");
/* 112 */     ITextureObject iTextureObject = textureManager.func_110581_b(resourceLocation);
/* 113 */     if (iTextureObject == null) {
/* 114 */       simpleTexture = new SimpleTexture(resourceLocation);
/* 115 */       return textureManager.func_110579_a(resourceLocation, (ITextureObject)simpleTexture);
/* 116 */     }  return (simpleTexture != TextureUtil.field_111001_a);
/*     */   }
/*     */ 
/*     */   
/*     */   public static vu v(ela.eos/moe/dragoncore/uba a, String str) {
/* 121 */     String str1 = a.t();
/*     */     
/* 123 */     if (!a.j) {
/* 124 */       Map map1 = q.get(str1);
/* 125 */       if (map1 != null) {
/* 126 */         vu vu1 = (vu)map1.get(str);
/* 127 */         if (vu1 == null) {
/* 128 */           return (vu)map1.get("hand");
/*     */         }
/* 130 */         return vu1;
/*     */       } 
/*     */     } 
/*     */ 
/*     */     
/*     */     try {
/* 136 */       Map<Object, Object> map1 = new HashMap<>();
/*     */       
/* 138 */       IResource iResource = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("dragoncore", "models/items/" + str1 + "/transform.yml"));
/*     */       
/* 140 */       YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(iResource.func_110527_b());
/*     */       
/* 142 */       for (String str2 : yamlConfiguration.getKeys(false)) {
/* 143 */         ConfigurationSection configurationSection = yamlConfiguration.getConfigurationSection(str2);
/* 144 */         if (configurationSection != null) {
/* 145 */           map1.put(str2, new vu(configurationSection));
/*     */         }
/*     */       } 
/* 148 */       q.put(str1, map1);
/* 149 */     } catch (IOException iOException) {
/* 150 */       iOException.printStackTrace();
/* 151 */       q.put(str1, new HashMap<>());
/*     */     } 
/* 153 */     Map map = q.get(str1);
/* 154 */     vu vu = (vu)map.get(str);
/* 155 */     if (vu == null) {
/* 156 */       return (vu)map.get("hand");
/*     */     }
/* 158 */     return vu;
/*     */   }
/*     */ 
/*     */   
/*     */   public static void v(UUID a, String str) {
/* 163 */     EntityLivingBase entityLivingBase = ya.v(a);
/* 164 */     if (entityLivingBase != null && !entityLivingBase.func_184614_ca().func_190926_b()) {
/* 165 */       ela.eos/moe/dragoncore/uba eos/moe/dragoncore/uba = ela.s.v(entityLivingBase.func_184614_ca());
/* 166 */       if (eos/moe/dragoncore/uba != null) {
/* 167 */         v(a, eos/moe/dragoncore/uba, str, false);
/*     */       }
/*     */     } 
/*     */   }
/*     */   
/*     */   public static void v(UUID a, ela.eos/moe/dragoncore/uba eos/moe/dragoncore/uba1, String str, boolean bool) {
/* 173 */     String str1 = eos/moe/dragoncore/uba1.h();
/*     */     
/* 175 */     ModelBase modelBase = w.get(str1);
/*     */     
/* 177 */     if (modelBase instanceof iy) {
/* 178 */       iy iy = (iy)modelBase;
/* 179 */       iy.setAnimation("idle");
/* 180 */     } else if (modelBase instanceof ld) {
/* 181 */       if (!i.containsKey(a.toString() + "_" + str1)) {
/* 182 */         pm pm = pm.z();
/* 183 */         pm.v();
/*     */         try {
/* 185 */           Map<String, bo> map = mm.v(new ResourceLocation("dragoncore", "models/items/" + eos/moe/dragoncore/uba1
/* 186 */                 .t() + "/animation.json"));
/*     */           
/* 188 */           pm.v(map);
/* 189 */           map.forEach((str, bo1) -> {
/*     */                 if (str.contains("idle")) {
/*     */                   a.v(new gk(bo1, 0), "base");
/*     */                 }
/*     */               });
/* 194 */         } catch (Exception exception) {}
/*     */ 
/*     */         
/* 197 */         i.put(a + "_" + str1, pm.v());
/*     */       } 
/* 199 */       zz zz = i.get(a + "_" + str1);
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */       
/* 212 */       if ("idle".equals(str)) {
/* 213 */         if (zz.v() != null) {
/*     */           
/* 215 */           be be = zz.v("base");
/* 216 */           if (be.v() == null) {
/* 217 */             gk gk = zz.v().v();
/* 218 */             zz.v(gk, "base");
/*     */           } 
/* 220 */           if (!zz.isOnPlayAnimation()) {
/* 221 */             gk gk = zz.v().v();
/* 222 */             zz.v(gk, "base");
/*     */           } 
/*     */         } 
/*     */       } else {
/* 226 */         bo bo = zz.h().get(str);
/* 227 */         if (bo != null) {
/* 228 */           zz.v(new gk(bo, 0), "base");
/*     */         }
/*     */       } 
/* 231 */       if (bool)
/* 232 */         zz.v((ld)modelBase); 
/*     */     } 
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\tr.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */